﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using ScrollingBackgroundSpace;

namespace MiaProject
{
    public class Gui2D
    {
        private Texture2D shot;
        private Texture2D background;
        private ScrollingBackground myBackground1;
        public int nrshots;
        public int totalNrShots;
        public int totalShotsLevels;
        public Gui2D()
        {
            nrshots = 5;
            totalShotsLevels = 0;
            totalNrShots = 0;
        }
        public void load(GraphicsDevice graphicsDevice, ContentManager content)
        {

            shot = content.Load<Texture2D>("img/shot");
            background = content.Load<Texture2D>("img/wall");
            background = content.Load<Texture2D>("img/wall");

            myBackground1 = new ScrollingBackground();
            Texture2D background1 = content.Load<Texture2D>("back03");
            myBackground1.Load(graphicsDevice, background1);

            
        }
        public void update(GameTime gameTime)
        {
            float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;
            myBackground1.Update((float)(elapsed * 30));

        }
        public void draw(GameTime gameTime, SpriteBatch spriteBatch, GraphicsDeviceManager graphics)
        {
            myBackground1.Draw(spriteBatch);

            spriteBatch.Draw(background, new Vector2(0, 0), new Rectangle(0, 0, background.Width, background.Height), Color.White, 0, Vector2.Zero, 1.0f, SpriteEffects.None, 0f);

            int px = 5;
            for (int i = 0; i < nrshots; i++)
            {
                spriteBatch.Draw(shot, new Vector2(px, 450), new Rectangle(0, 0, shot.Width, shot.Height), Color.White, 0, Vector2.Zero, 1.0f, SpriteEffects.None, 0f);
                px += shot.Width + 10;
            }
            
        }
    }
}
